package com.cdream.basic.algorithm.leetcode.findElement;

/**
 * @author cdream
 * @date 6/3/21
 */
public class Question35 {
    public int searchInsert(int[] nums, int target) {
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == target) {
                return i;
            }

            if (nums[i] > target) {
                return i;
            }
        }
        return nums.length;
    }
}
